#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
int main()
{
	int n = 0, m = 0;
	scanf("%d %d", &n, &m);
	int temp = n ^ m;
	int cn = 0;
	if (temp < 0)
	{
		cn++;
		temp ^= (1 << 31);
	}
	for (int i = 1; i <= 32; i++)
	{
		int w = temp >> 1;
		if ((temp - w * 2) % 2 != 0)
			cn++;
		temp = temp >> 1;
	}
	printf("%d\n", cn);
	return 0;
}